Introduction to eyap
The eyap package is an extended yapping and comment management system written in python. The basic goal is to provide a high-level comment management system which can be used with various back-ends.
Quick start
The following example is from `eyap/__init__.py <https://github.com/emin63/eyap/blob/master/eyap/__init__.py>`__:
With eyap, you can choose a backend to manage your comments. A key goal of the eyap package is that you can write your code in a generic way and easily switch the back-end. For example, you can use a simple file back-end with something like like the following:
>>> import eyap, tempfile, os, shutil # Import some things used for demo.
>>> backend = 'file' # Use a simple file backend for demo.
>>> finfo = {'owner': 'emin63', 'realm': tempfile.mkdtemp(), 'topic': 'test'}
>>> comment_thread = eyap.Make.comment_thread('file', **finfo)
>>> comment_thread.add_comment('Testing things', allow_create=True)
>>> comment_thread.add_comment('is great!')
The code above will create a new comment thread and add a comment to it while also creating the thread if it does not exist. Later, you could access the thread via something like:
>>> print(str(comment_thread.lookup_comments())) # doctest: +ELLIPSIS ======================================== Subject: Testing things ... Timestamp: ... ---------- Testing things ======================================== Subject: is great! ... Timestamp: ... ---------- is great!
The main reason for the existence of something like eyap is so that you could use pretty much the same exact code with a different backend. For example, using ‘github’ instead of ‘file’ and setting realm/owner to the organization/repo in github while providing a valid user/token for github access will post or read an issue from github.
>>> ginfo = {'owner': 'emin63', 'realm': 'eyap', 'topic': 'Describe usage'}
>>> g_thread = eyap.Make.comment_thread('github', **ginfo)
>>> print(str(g_thread.lookup_comments())) # doctest: +ELLIPSIS
========================================
Subject: We need a simple description of how to u ...
Timestamp: 2017-07-19T22:26:51Z
----------
We need a simple description of how to use eyap.
========================================
Subject: Start with top-level README.md ...
Timestamp: 2017-07-19T22:22:56Z
----------
Start with top-level README.md
========================================
Subject: All done! ...
Timestamp: 2017-07-19T22:26:51Z
----------
All done!
Note that in the above, we only read from github since we did not provide any username or password. If you had a username and token or password, you could post comments to github as well.
Plesae do NOT post to above issue; use your own repo for tests. :)
Finally, we cleanup the file based backend since we don’t need it anymore.
>>> shutil.rmtree(finfo['realm']) # Remove the directory to cleanup test. >>> os.path.exists(finfo['realm']) # Verify we cleaned up. False
Back ends
We currently have the following back-ends available:
file: A simple file-based back-end. github: Reading/writing comments to github issues. redis: Use redis to store comments. You will have to install redis and redis-py (e.g., with pip install redis) for this to work.
Pull requests are welcome to add more back-ends.
Metadata
Release files for eyap 0.9.7
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 | Actions |
|---|---|---|---|---|
| eyap-0.9.7.tar.gz | 19.6 kB | Without provenance | Details for eyap-0.9.7.tar.gz |
Release files / eyap-0.9.7.tar.gz
| Download URL | eyap-0.9.7.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
034251b94cb2b0cac067aa97649f0a151e8241c13fdfc6ece45eee61907e7864
|
|
BLAKE2b-256 checksum How to use checksums |
31034943d7358046b9e235265df508c2166e213c90299a2d46ed3106724422f5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.13
|
Security for eyap 0.9.7
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.