This module defines a simple API for storing and retrieving Atom entries in different storage backends. Entries are defined using a JSON-like syntax:
>>> import datetime
>>> entry = {'id' : 'http://example.com/1',
... 'title' : 'My first entry',
... 'updated': datetime.datetime.utcnow(),
... }
The module comes with a shelve backend:
>>> from atomstorage import EntryManager
>>> em = EntryManager('shelve://file.db')
>>> em.create_entry(entry)
{'updated': datetime.datetime(2006, 8, 15, 16, 27, 7, 960677),
'id': 'http://example.com/1',
'title': 'My first entry'}
New backends can be easily added by creating a module and setting an atomstorage.backend entry point. A SQLite backend is currently being developed.
The API defines a few methods the entry manager should have. To retrieve all entries, sorted by time (last to first):
>>> entries = em.get_entries()
The last 10 entries:
>>> entries = em.get_entries(10)
Retrieve the entry with id “1”:
>>> entry = em.get_entry("1")
Delete the same entry:
>>> em.delete_entry("1")
Get all entries from August 2006:
>>> entries = em.get_entries_by_date(2006, 8)
Or from the “tech” category:
>>> entries = em.get_entries_by_category("tech")
To search for entries mentioning “Python”:
>>> entries = em.search("Python")
The API is by no means final. Comments, suggestions, patches and critics are welcome.
Metadata
Release files for atomstorage 0.1.2.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 | |
|---|---|---|---|---|
| atomstorage-0.1.2.1.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| atomstorage-0.1.2.1-py2.4.egg | Legacy Egg format | - | - | Details |
Total release size: 13.5 kB
Release files / atomstorage-0.1.2.1.tar.gz
| Download URL | atomstorage-0.1.2.1.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b91350344ef9e7018e3c84b34cc831f17737b19a88d866c48352d21d7dcd6bf
|
|
BLAKE2b-256 checksum How to use checksums |
15120c11d23a6bce92f6e11f0a97c5f973e3f5ebaa480b6aedc0895dd415152c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / atomstorage-0.1.2.1-py2.4.egg
| Download URL | atomstorage-0.1.2.1-py2.4.egg |
|---|---|
| Size | 8.3 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
d88baf846757411fd44290ff47df9274c5a606306134f65de148427bc67cdf17
|
|
BLAKE2b-256 checksum How to use checksums |
ec3453240e9feda9189c1e1f9a94dd3bc9c34985791f9ea418a01a0860029e86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for atomstorage 0.1.2.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.