{"id":13897431,"url":"https://github.com/gumblex/fossilpy","last_synced_at":"2025-04-10T11:35:04.564Z","repository":{"id":57431987,"uuid":"96032112","full_name":"gumblex/fossilpy","owner":"gumblex","description":"Simple python library for reading Fossil repositories","archived":false,"fork":false,"pushed_at":"2024-12-29T04:00:22.000Z","size":13,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-24T19:52:32.317Z","etag":null,"topics":["fossil-scm"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gumblex.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-02T15:27:37.000Z","updated_at":"2024-12-29T04:00:25.000Z","dependencies_parsed_at":"2022-09-19T08:01:46.282Z","dependency_job_id":null,"html_url":"https://github.com/gumblex/fossilpy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Ffossilpy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Ffossilpy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Ffossilpy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gumblex%2Ffossilpy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gumblex","download_url":"https://codeload.github.com/gumblex/fossilpy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248208690,"owners_count":21065205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fossil-scm"],"created_at":"2024-08-06T18:03:35.171Z","updated_at":"2025-04-10T11:34:59.502Z","avatar_url":"https://github.com/gumblex.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"fossilpy\n========\nSimple pure-python library for reading Fossil repositories.\n\n.. code-block:: pycon\n\n   \u003e\u003e\u003e r = Repo('project.fossil')\n   \u003e\u003e\u003e f = r.file(123)\n   \u003e\u003e\u003e f.blob\n   b'File content...'\n   \u003e\u003e\u003e filelist = r.manifest(124).F\n   \u003e\u003e\u003e filelist\n   [('file', '1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')]\n\nThis is a thin wrapper, and Fossil is an SQLite-based version control system.\nSo using raw SQL (``Repo.execute``) may be necessary to get more information.\n\nWriting, 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.\n\nInstall `python-fossil-delta` for better performance.\n\nAPI\n---\n\nClasses\n~~~~~~~\n\n- **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.\n\n  - Repo.\\ **file(self, key)**: Returns a ``File`` according to the ``key``, which is either the blob's rid or uuid (SHA1/SHA3-256).\n\n  - Repo.\\ **manifest(self, key)**: Returns a ``StructuralArtifact`` according to the ``key``.\n\n  - Repo.\\ **artifact(self, key, type_=None)**: Returns an ``Artifact`` according to the ``key``. ``type_`` can be ``'structural'`` or ``'file'``.\n\n  - Repo.\\ **__getitem__(self, key)**: Returns an ``Artifact`` according to the ``key``.\n\n  - Repo.\\ **find_artifact(self, prefix)**: Given the uuid (SHA1/SHA3-256) prefix, returns a tuple ``(rid, uuid)``. If not found, raises a ``KeyError``.\n\n  - Repo.\\ **to_uuid(self, rid)**: Given the rid, returns the uuid of a blob. If not found, raises an ``IndexError``.\n\n  - Repo.\\ **to_rid(self, uuid)**: Given the uuid, returns the rid of a blob. If not found, raises an ``IndexError``.\n\n  - Repo.\\ **execute(self, sql, parameters=None)**: Execute raw SQL statements on the Fossil repo (SQLite database). See also `src/schema.c \u003chttps://www.fossil-scm.org/index.html/artifact/f72846e4a8e2929f\u003e`_.\n\n- **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.\n\n- **File(blob=None, rid=None, uuid=None)**: Represents a file, same as ``Artifact``.\n\n- **StructuralArtifact(blob=None, rid=None, uuid=None)**: Represent a structural artifact, aka. manifest, can be such as check-in, wiki and tickets.\n\n  - StructuralArtifact.\\ **keys()**: List cards.\n  - StructuralArtifact.\\ **cards**: Dictionary of cards. If a card type can occur multiple times, cards of the same type are stored in a list.\n  - Cards can be accessed like ``art.F``, ``art['F']`` or ``art.file``. See also `Fossil documentation \u003chttps://www.fossil-scm.org/index.html/doc/trunk/www/fileformat.wiki#structural\u003e`_. Some useful cards: F(file), C(comment), P(parent_artifact), U(user_login), D(datetime), W(wiki_text)\n\n\nMisc.\n~~~~~\n\n- **LRUCache(maxlen)**: A simple implementation of least recently used (LRU) cache.\n\nFossil uses Julian date in most tables.\n\n- **julian_to_unix(t)**: Convert Julian date ``t`` to unix timestamp.\n- **unix_to_julian(t)**: Convert unix timestamp ``t`` to Julian date.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgumblex%2Ffossilpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgumblex%2Ffossilpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgumblex%2Ffossilpy/lists"}