Skip to content

Support for reading auth env vars from .env file#105

Draft
elacuesta wants to merge 1 commit into
zytedata:mainfrom
elacuesta:dotenv-support
Draft

Support for reading auth env vars from .env file#105
elacuesta wants to merge 1 commit into
zytedata:mainfrom
elacuesta:dotenv-support

Conversation

@elacuesta

Copy link
Copy Markdown
Member

@elacuesta elacuesta changed the title dotenv support Support for reading auth env vars from .env file Jun 19, 2026
@codecov

codecov Bot commented Jun 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.16%. Comparing base (ae5e382) to head (25f7373).

Files with missing lines Patch % Lines
zyte_api/_async.py 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #105      +/-   ##
==========================================
- Coverage   98.24%   93.16%   -5.08%     
==========================================
  Files          18       18              
  Lines         741      761      +20     
  Branches       78       83       +5     
==========================================
- Hits          728      709      -19     
- Misses         10       48      +38     
- Partials        3        4       +1     
Files with missing lines Coverage Δ
zyte_api/__main__.py 61.29% <100.00%> (-29.77%) ⬇️
zyte_api/_sync.py 100.00% <ø> (ø)
zyte_api/apikey.py 100.00% <100.00%> (ø)
zyte_api/constants.py 100.00% <100.00%> (ø)
zyte_api/_async.py 97.29% <80.00%> (-1.30%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread docs/use/x402.rst
Comment on lines +75 to +80
Unlike :ref:`the Zyte API key <api-key>`, the Ethereum private key is read
**only** from a ``.env`` file in the current directory; parent directories are
not searched, to limit the risk of loading it from an unrelated ``.env`` file.
To read it from a different location, use the ``--dotenv-path`` switch or the
``dotenv_path`` parameter, which apply to both credentials. The environment
variable takes precedence over the file, which is never modified.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kmike Thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants