Skip to main content

Simple pure-python library for reading Fossil repositories.

>>> r = Repo('project.fossil')
>>> f = r.file(123)
>>> f.blob
b'File content...'
>>> filelist = r.manifest(124).F
>>> filelist
[('file', '1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')]

This is a thin wrapper, and Fossil is an SQLite-based version control system. So using raw SQL (Repo.execute) may be necessary to get more information.

Writing, committing, or executing Fossil commands is not supported. (Although you can do SQL, writing is not recommended.) Reading the config database (~/.fossil), the checkout database (_FOSSIL_), or the checkout directory is also not supported.

Install python-fossil-delta for better performance.

API

Classes

  • Repo(repository, check=False, cachesize=64): Represents a Fossil repo. repository is the file name. check specifies whether to calculate checksum. If numpy is not installed, calculation will be much slower. cachesize specifies how much blobs should be cached, set to 0 to disable.

    • Repo.file(self, key): Returns a File according to the key, which is either the blob’s rid or uuid (SHA1/SHA3-256).

    • Repo.manifest(self, key): Returns a StructuralArtifact according to the key.

    • Repo.artifact(self, key, type_=None): Returns an Artifact according to the key. type_ can be 'structural' or 'file'.

    • Repo.__getitem__(self, key): Returns an Artifact according to the key.

    • Repo.find_artifact(self, prefix): Given the uuid (SHA1/SHA3-256) prefix, returns a tuple (rid, uuid). If not found, raises a KeyError.

    • Repo.to_uuid(self, rid): Given the rid, returns the uuid of a blob. If not found, raises an IndexError.

    • Repo.to_rid(self, uuid): Given the uuid, returns the rid of a blob. If not found, raises an IndexError.

    • Repo.execute(self, sql, parameters=None): Execute raw SQL statements on the Fossil repo (SQLite database). See also src/schema.c.

  • Artifact(blob=None, rid=None, uuid=None): Represents a Fossil artifact, which is anything inside the blob table. Has attributes blob, rid and uuid. blob is the artifact(file) content.

  • File(blob=None, rid=None, uuid=None): Represents a file, same as Artifact.

  • StructuralArtifact(blob=None, rid=None, uuid=None): Represent a structural artifact, aka. manifest, can be such as check-in, wiki and tickets.

    • StructuralArtifact.keys(): List cards.

    • StructuralArtifact.cards: Dictionary of cards. If a card type can occur multiple times, cards of the same type are stored in a list.

    • Cards can be accessed like art.F, art['F'] or art.file. See also Fossil documentation. Some useful cards: F(file), C(comment), P(parent_artifact), U(user_login), D(datetime), W(wiki_text)

Misc.

  • LRUCache(maxlen): A simple implementation of least recently used (LRU) cache.

Fossil uses Julian date in most tables.

  • julian_to_unix(t): Convert Julian date t to unix timestamp.

  • unix_to_julian(t): Convert unix timestamp t to Julian date.

Metadata

Release files for fossilpy 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fossilpy 0.3.1
File Size Uploaded Provenance
fossilpy-0.3.1.tar.gz 6.3 kB Without provenance Details

Release files / fossilpy-0.3.1.tar.gz

Download URL fossilpy-0.3.1.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
fb88d85062c8d9fbc5d1d1ec005c76266a59671d1b648b6e510a6f06335a75c1
BLAKE2b-256 checksum
How to use checksums
5a22c91cac9d28a45c0f01ac6e34521c13076c373ff184c793bdf66824243686
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.5

Security for fossilpy 0.3.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.

Release history Release notifications | RSS feed

This release

0.3.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page