s3:, gs: and az:
Each needs its own extra: s3, gs or az.
pathlib_next.uri.schemes.s3
BaseS3Backend
Bases: object
Protocol for obtaining a boto3 S3 client. Subclass this to plug in
custom credential/session handling (e.g. tests mock it directly, no
real AWS account needed); S3Backend is the real implementation.
client()
Source code in src/pathlib_next/uri/schemes/s3.py
30 31 | |
S3Backend(**client_kwargs)
Bases: BaseS3Backend
Lazily creates+caches a boto3 S3 client. Unlike sftp.py's/
ftp.py's per-thread connection pools, a single boto3 client is
reused across threads -- it's documented as thread-safe.
Source code in src/pathlib_next/uri/schemes/s3.py
41 42 43 | |
client_kwargs = client_kwargs
instance-attribute
client()
Source code in src/pathlib_next/uri/schemes/s3.py
45 46 47 48 49 50 | |
S3Path(*uris, **options)
Bases: UriPath
s3: scheme (s3://bucket/key/path): read/write/list via boto3.
Requires the s3 extra. S3 has no real directories -- is_dir() is
prefix emulation (any object key under "<path>/"), and mkdir()
creates a zero-byte "<path>/" marker object (the same convention the
AWS console itself uses for an empty "folder"); see
docs/divergences.md. rename() uses server-side copy_object +
delete_object (same-bucket only) instead of the generic
download+upload+delete move() fallback; a prefix directory is not
renamed (NotImplementedError), so move() copies and removes it.
Source code in src/pathlib_next/uri/__init__.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
backend
instance-attribute
bucket
property
key
property
rename(target)
Source code in src/pathlib_next/uri/schemes/s3.py
550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 | |
rm(recursive=False, missing_ok=False, ignore_error=False)
Source code in src/pathlib_next/uri/schemes/s3.py
475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 | |
rmdir()
Source code in src/pathlib_next/uri/schemes/s3.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 | |
stat(*, follow_symlinks=True)
Source code in src/pathlib_next/uri/schemes/s3.py
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | |
unlink(missing_ok=False)
Source code in src/pathlib_next/uri/schemes/s3.py
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 | |
pathlib_next.uri.schemes.gs
BaseGsBackend
Bases: object
Protocol for obtaining a google.cloud.storage Client. Subclass this
to plug in custom credential/session handling (e.g. tests can override to
point at a fake server); GsBackend is the real implementation.
client()
Source code in src/pathlib_next/uri/schemes/gs.py
22 23 | |
GsBackend(**client_kwargs)
Bases: BaseGsBackend
Lazily creates+caches a google.cloud.storage Client. A single client
is reused across threads -- it's documented as thread-safe.
client_kwargs go to storage.Client unchanged, client_options
(dict or ClientOptions, api_endpoint included) among them. A custom
endpoint still authenticates; for an emulator or fake server pass
use_auth_w_custom_endpoint=False (anonymous credentials), or set
STORAGE_EMULATOR_HOST yourself -- the SDK reads it.
Source code in src/pathlib_next/uri/schemes/gs.py
38 39 40 | |
client_kwargs = client_kwargs
instance-attribute
client()
Source code in src/pathlib_next/uri/schemes/gs.py
42 43 44 45 46 47 48 49 50 51 52 53 | |
GsPath(*uris, **options)
Bases: UriPath
gs: scheme (gs://bucket/key/path): read/write/list via
google.cloud.storage. Requires the gs extra. GCS has no real
directories -- is_dir() is prefix emulation (any object key under
"<path>/"), and mkdir() creates a zero-byte "<path>/" marker
object; see docs/divergences.md. rename() uses server-side copy +
delete (same-bucket only) instead of the generic download+upload+delete
move() fallback; a prefix directory is not renamed
(NotImplementedError), so move() copies and removes it.
Source code in src/pathlib_next/uri/__init__.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
backend
instance-attribute
bucket_name
property
key
property
rename(target)
Source code in src/pathlib_next/uri/schemes/gs.py
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 | |
rm(recursive=False, missing_ok=False, ignore_error=False)
Source code in src/pathlib_next/uri/schemes/gs.py
338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 | |
rmdir()
Source code in src/pathlib_next/uri/schemes/gs.py
324 325 326 327 328 329 330 331 332 333 334 335 336 | |
stat(*, follow_symlinks=True)
Source code in src/pathlib_next/uri/schemes/gs.py
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
unlink(missing_ok=False)
Source code in src/pathlib_next/uri/schemes/gs.py
305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | |
pathlib_next.uri.schemes.az
BaseAzBackend
Bases: object
Protocol for obtaining an azure.storage.blob.BlobServiceClient.
Subclass this to plug in custom credential/session handling (e.g. tests
can override to point at a fake server); AzBackend is the real
implementation.
client()
Source code in src/pathlib_next/uri/schemes/az.py
24 25 | |
AzBackend(account=None, **client_kwargs)
Bases: BaseAzBackend
Lazily creates+caches an azure.storage.blob.BlobServiceClient. A
single client is reused across threads -- it's documented as
thread-safe.
client_kwargs go to BlobServiceClient unchanged; with
connection_string, to BlobServiceClient.from_connection_string
(credential and the other options included). account, when given
and neither account_url nor connection_string is, derives
account_url="https://<account>.blob.core.windows.net", authenticated
by azure-identity's DefaultAzureCredential unless credential is
passed -- the backend an AzPath built without backend= uses.
Source code in src/pathlib_next/uri/schemes/az.py
57 58 59 60 | |
account = account
instance-attribute
client_kwargs = client_kwargs
instance-attribute
client()
Source code in src/pathlib_next/uri/schemes/az.py
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
AzPath(*uris, **options)
Bases: UriPath
az: scheme (az://account/container/key/path): read/write/list via
azure.storage.blob. Requires the az extra. Azure Blob has no real
directories -- is_dir() is prefix emulation (any blob key under
"<path>/"), and mkdir() creates a zero-byte "<path>/" marker blob;
see docs/divergences.md. rename() uses server-side copy + delete
(same-container only) instead of the generic download+upload+delete
move() fallback; a prefix directory is not renamed
(NotImplementedError), so move() copies and removes it.
Without backend=, the client targets the URI's account
(https://<account>.blob.core.windows.net) with azure-identity's
DefaultAzureCredential; ImportError if azure-identity is missing.
Source code in src/pathlib_next/uri/__init__.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
account
property
backend
instance-attribute
container
property
key
property
rename(target)
Source code in src/pathlib_next/uri/schemes/az.py
513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 | |
rm(recursive=False, missing_ok=False, ignore_error=False)
Source code in src/pathlib_next/uri/schemes/az.py
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | |
rmdir()
Source code in src/pathlib_next/uri/schemes/az.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
stat(*, follow_symlinks=True)
Source code in src/pathlib_next/uri/schemes/az.py
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 | |
unlink(missing_ok=False)
Source code in src/pathlib_next/uri/schemes/az.py
378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 | |