pyfiles
A Big file collection manager.
Install
In a virtual env:
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip wheel
pip install git+git://github.com/jrmi/pyfiles@master # Or any last commit
# Then create your setup.py file before using CLI
CLI
Create a settings.py files where you want to execute the cli with this configuration for file storage:
BACKEND = "pyfiles.storages.diskstorage.DiskStorage"
BACKEND_OPTIONS = {
"basepath": "/tmp/tmpdir",
"base_url": "http://localhost:8000"
}
And for S3:
BACKEND = "pyfiles.storages.s3storage.S3Storage"
BACKEND_OPTIONS = {
"access_key":"<you-S3-access-key>",
"secret_key":"<you-S3-secret-key>",
"endpoint_url":"<S3-api-endpoint>",
"region_name":"<region>",
"bucket_name":"<bucket name>",
}
Then to store a file:
$ pyfiles store <file path> <file.namespace> <file.name> <version>
version should respect the format: YYYY.MM.DD-Rev or any semver like X.Y.Z
To list all version of a file:
$ pyfiles versions <file.namespace> <file.name>
To search for a file:
$ pyfiles search <file.namespace> <file.name> [<version-prefix>]
version-prefix can be YYYY or X or YYYY.MM or X.Y or YYYY.MM.DD or X.Y.Z or Latest. Latest by default if missing.
Finnaly to delete a file:
$ pyfiles delete <file.namespace> <file.name> <version>
To start the web api server:
$ pyfiles serve
Web API
GET on /search/<namespace>/<filename>[?version=<version>]
To get file version download link. Namespace is a namespace to organise data and filename is the file name. You can optionnaly add a version like latest or <year> or <year.month> or <major> or <major>.<minor>, … You get the latest for the specified version.
GET on /versions/<namespace>/<filename>
To show all avaible file versions.
Python API
See pyfiles.storage classes for more informations.
You can use pyfiles.storage.get_storage(<backend path>, <options>) to initialize your storage.
Features
An API to download files with rich version selection
List all version of a file
Can be used for CSV or Geojson files
File can have version like 2018.01.10-01
Find file by a part of the version. 2018 or 2018.01
Roadmap
Allow authentification with private data
Handle file diff between versions
Get the update date of a file to ease caching
Add a client library and CLI
License
Free software: MIT license
Documentation: https://pyfiles.readthedocs.io.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.1 (2020-12-17)
First release on PyPI.
Metadata
Release files for bygfiles 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bygfiles-0.1.1.tar.gz | 20.8 kB | Without provenance | Details |
Release files / bygfiles-0.1.1.tar.gz
| Download URL | bygfiles-0.1.1.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fa48153a2451e4f066e75ccb1f925becdd27a9042fe807ce0414ade9ee4b0393
|
|
BLAKE2b-256 checksum How to use checksums |
3d5961f44e6df31f4b7c5a889abd11a2da2cfc5213efccc6d337687831499ee0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5
|
Security for bygfiles 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.