Skip to content

Commit d6261c6

Browse files
committed
Add README and more setup kwargs.
1 parent af69d9b commit d6261c6

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# nats_request_asap
2+
3+
Python function to return one or multiple responses to a NATS request as soon as possible.
4+
5+
## Installation
6+
7+
```
8+
pip install nats_request_asap
9+
```
10+
11+
## Usage
12+
13+
### One response
14+
15+
Return a single NATS `Msg`.
16+
17+
```
18+
>>> import nats_request_asap
19+
>>> nats_request_asap.req_asap(z, b'{"nodes": ["af9c"]}', timeout=5)
20+
<Msg: subject='_INBOX.tdSY0nNLoa9bYPqw9moCwC' reply='' data='{"initial_...'>
21+
```
22+
23+
### Multiple responses
24+
25+
Return a list of NATS `Msg`s.
26+
27+
```
28+
>>> nats_request_asap.req_asap(z, b'{"nodes": "all"}', expected=3, timeout=5)
29+
[<Msg: subject='_INBOX.tdSY0nNLoa9bmNqw9moCwC' reply='' data='{"error": ...'>,
30+
<Msg: subject='_INBOX.tdSY0nNLoa9bmNqw9moCwC' reply='' data='{"initial_...'>,
31+
<Msg: subject='_INBOX.tdSY0nNLoa9bmNqw9moCwC' reply='' data='{"initial_...'>]
32+
```

setup.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,53 @@
1+
from os.path import dirname, join
2+
13
from setuptools import find_packages, setup
24

5+
6+
def read(*names, **kwargs):
7+
with open(
8+
join(dirname(__file__), *names), encoding=kwargs.get("encoding", "utf8")
9+
) as openfile:
10+
return openfile.read()
11+
12+
313
setup(
414
name="nats-request-asap",
515
packages=find_packages("src"),
616
package_dir={"": "src"},
17+
version="0.1",
18+
license="BSD-2-Clause",
19+
description="Python function to return one or multiple responses to a "
20+
"NATS request as soon as possible. ",
21+
long_description=read("README.md"),
22+
author="Hugo O. Rivera",
23+
author_email="hugo@roguh.com",
24+
url="https://github.com/roguh/nats_request_asap",
25+
include_package_data=True,
26+
zip_safe=False,
27+
classifiers=[
28+
"Intended Audience :: Developers",
29+
"Operating System :: Unix",
30+
"Operating System :: POSIX",
31+
"Operating System :: Microsoft :: Windows",
32+
"Programming Language :: Python",
33+
"Programming Language :: Python :: 3",
34+
"Programming Language :: Python :: 3.6",
35+
"Programming Language :: Python :: 3.7",
36+
"Programming Language :: Python :: 3.8",
37+
"Programming Language :: Python :: 3.9",
38+
"Programming Language :: Python :: Implementation :: CPython",
39+
"Programming Language :: Python :: Implementation :: PyPy",
40+
"Topic :: Utilities",
41+
],
42+
project_urls={
43+
"Issue Tracker": "https://github.com/roguh/nats_request_asap/issues",
44+
},
45+
keywords=["NATS", "NATS request", "response as soon as possible", "asap response"],
46+
python_requires=">2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*",
47+
install_requires=[
48+
# eg: 'aspectlib==1.1.1', 'six>=1.7',
49+
],
50+
extras_require={},
51+
setup_requires=[],
52+
entry_points={},
753
)

0 commit comments

Comments
 (0)