Skip to content

Commit

Permalink
Remove neverest (#6)
Browse files Browse the repository at this point in the history
* chore: neverest -> datamaxi

* chore: nvrst -> dtmx
  • Loading branch information
martinkersner authored Apr 19, 2024
1 parent 83b8689 commit 7947171
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ You may use environment variables to configure the DataMaxi+ client to avoid any

| Env | Description |
| ------------------ | -------------------------------------------- |
| `NEVEREST_API_KEY` | Used instead of `api_key` if none is passed. |
| `DATAMAXI_API_KEY` | Used instead of `api_key` if none is passed. |

## Quickstart

Expand Down
8 changes: 4 additions & 4 deletions datamaxi/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class API(object):
"""The base class for all DataMaxi+ Python clients. `api_key` can be set
as an environment variable `NEVEREST_API_KEY`.
as an environment variable `DATAMAXI_API_KEY`.
"""

def __init__(
Expand All @@ -24,7 +24,7 @@ def __init__(
show_header=False,
):
"""Client API constructor. `api_key` can be set
as an environment variable `NEVEREST_API_KEY`.
as an environment variable `DATAMAXI_API_KEY`.
Args:
api_key (str): The API key for the DataMaxi+ API.
Expand All @@ -34,7 +34,7 @@ def __init__(
show_limit_usage (bool): Show the limit usage.
show_header (bool): Show the header.
"""
self.api_key = api_key or os.environ.get("NEVEREST_API_KEY")
self.api_key = api_key or os.environ.get("DATAMAXI_API_KEY")
self.base_url = base_url
self.timeout = timeout
self.proxies = None
Expand All @@ -46,7 +46,7 @@ def __init__(
{
"Content-Type": "application/json;charset=utf-8",
"User-Agent": "datamaxi/" + __version__,
"Authorization": "X-NVRST-APIKEY " + str(self.api_key),
"Authorization": "X-DTMX-APIKEY " + str(self.api_key),
}
)

Expand Down
8 changes: 4 additions & 4 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def test_API_initial():
"datamaxi/" + __version__
)
client.session.headers.should.have.key("Authorization").which.should.be.equal(
"X-NVRST-APIKEY None"
"X-DTMX-APIKEY None"
)

client._logger.should.be(logging.getLogger("datamaxi.api"))
Expand All @@ -34,13 +34,13 @@ def test_API_env_key():
"""Tests the API initialization with API key in environment variable"""

api_key = random_str()
os.environ["NEVEREST_API_KEY"] = api_key
os.environ["DATAMAXI_API_KEY"] = api_key
client = API()

client.should.be.a(API)
client.api_key.should.be.equal(api_key)
client.session.headers.should.have.key("Authorization").which.should.be.equal(
f"X-NVRST-APIKEY {api_key}"
f"X-DTMX-APIKEY {api_key}"
)


Expand Down Expand Up @@ -68,5 +68,5 @@ def test_API_with_extra_parameters():
client.show_header.should.be.true
client.proxies.should.equal(proxies)
client.session.headers.should.have.key("Authorization").which.should.equal(
f"X-NVRST-APIKEY {api_key}"
f"X-DTMX-APIKEY {api_key}"
)

0 comments on commit 7947171

Please sign in to comment.