Skip to main content

PyRepec

CI PyPI downloads

PyRepec is a small Python client for the RePEc API. It provides typed result models, basic in-session caching, and helpers for querying authors, publications, bibliographic references, and JEL codes.

Current Version: 0.2.5

Requirements

  • Python 3.12 or newer
  • A RePEc API token

Installation

Install the package from PyPI:

pip install pyrepec

Quick start

Keep the API token outside your source code, for example in the REPEC_TOKEN environment variable:

export REPEC_TOKEN="your-token"

Create a client and perform a request:

import os

from pyrepec import Repec

repec = Repec(os.environ["REPEC_TOKEN"])
result = repec.get_org_authors("RePEc:edi:bdigvit")

if result.error is not None:
    print(f"RePEc error {result.error.code}: {result.error.message}")
else:
    for author in result.data:
        print(author)

Successful responses expose their payload through result.data. Errors reported by RePEc are available through result.error; in that case, result.data is empty. HTTP errors are raised by requests in the usual way.

Available methods

Method Description Result type
get_org_authors(org_id) Get the authors associated with an organization. RepecResultList
get_author_data(author_id) Get the full record for an author. RepecSingleResult
get_authors_for_item(item_id) Get the authors of a paper or article. RepecResultList
get_jel_codes(item_id) Get the JEL codes associated with an item. RepecJelResult
get_ref(item_id) Get the bibliographic references for an item. RepecSingleResult
get_error(err_code) Resolve a RePEc error code into its function and description. tuple[str, str]

The exact dictionaries returned in data follow the upstream RePEc API response format.

Development

Clone the repository and install the locked development environment:

git clone https://github.com/andrea-cap/pyrepec.git
cd pyrepec
uv sync --locked

Run the test suite and code-quality checks:

uv run pytest ./tests/
uv run ruff check .
uv run ruff format --check .

Integration tests require REPEC_TOKEN; without it, they are skipped. Unit tests do not make external API calls.

Generate the changelog from the available Git history:

uv run gitchangelog

Reporting issues

Report bugs and request features through the GitHub issue tracker.

Metadata

Release files for pyrepec 0.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrepec 0.2.5
File Size Uploaded Provenance Actions
pyrepec-0.2.5.tar.gz 8.3 kB Without provenance Details for pyrepec-0.2.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrepec 0.2.5
File Interpreter ABI Platform Actions
pyrepec-0.2.5-py3-none-any.whl Python 3 none any Details for pyrepec-0.2.5-py3-none-any.whl

Total release size: 15.0 kB

Release files / pyrepec-0.2.5.tar.gz

Download URL pyrepec-0.2.5.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3a8dc1d251a7591bf6355ef0be191cb1fd139799a4121aa70b3aeee4dc6c0c10
BLAKE2b-256 checksum
How to use checksums
eb1f65614ea8101fe53effc6d605914bc62dede1531db37b022f2529d75453db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pyrepec-0.2.5-py3-none-any.whl

Download URL pyrepec-0.2.5-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3ce212f5ac27fb986dfaa60244db0569f7b3e7631d5c1928a6cb4b98615b2480
BLAKE2b-256 checksum
How to use checksums
9168d6c10128f967fa09534a4f895eef12a11de049843264a4587a52ee0dab3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pyrepec 0.2.5

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page