Orquestador de consultas sobre SECOP desde el API del portal de datos abiertos.
Project description
pysecop 🇨🇴
pysecop is a high-performance Python package designed to interact seamlessly with Colombia's Public Procurement Data (SECOP I & II).
It abstracts the complexity of the Socrata (SODA) API, handles messy government data cleaning, and provides a fluent interface for building complex queries that are ready for Machine Learning and Big Data pipelines.
🚀 Why pysecop?
Public procurement data is the foundation of transparency and market intelligence. However, raw government APIs often return inconsistent formats, "polluted" URL strings, and fragmented schemas. pysecop solves this by providing:
- 🏗️ Fluent SoQL Builder: Build complex Socrata queries without writing a single line of raw SQL.
- 🧹 Automated Data Hygiene: Pre-configured processors for dates, URLs, and categorical encoding.
- 🔗 Unified Schema: High-level methods to join data across SECOP I and SECOP II seamlessly.
- 🐳 Production Ready: Fully Dockerized and tested for mission-critical ETL environments.
🛠️ Quick Start
Installation
pip install pysecop
Basic Fetching
from pysecop import SecopClient, QueryBuilder
client = SecopClient()
qb = QueryBuilder()
# Find the top 5 largest contracts in SECOP II
qb.select(["id_contrato", "valor_del_contrato", "nombre_entidad"]) \
.order("valor_del_contrato", "DESC") \
.limit(5)
df = client.fetch("SECOP_II", qb)
print(df.head())
🏛️ Project Architecture
The system follows a modular design to ensure scalability and ease of maintenance:
graph LR
A[SecopClient] -->|Builds| B[QueryBuilder]
A -->|Authenticates| C[Socrata API]
C -->|Returns Raw| D[DataFrame]
D -->|Refines| E[DataProcessor]
E -->|Output| F[Analysis Ready Data]
For a deeper dive into the system design, check out the Architecture Deep Dive.
📂 Documentation Layers
- ARCHITECTURE.md: Technical design, data flow, and architectural trade-offs.
- GUIDE.md: Full API reference, installation, and extension guide.
- USE_CASES.md: Business value, anti-corruption use cases, and market intelligence examples.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysecop-1.1.1.tar.gz.
File metadata
- Download URL: pysecop-1.1.1.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39516e101427d2cd5e2bccaefafecb9145b98bde80d92e4e78866d9c2ebbd72c
|
|
| MD5 |
1ebaf0e726962acdb49fc7c230907681
|
|
| BLAKE2b-256 |
e5800fe5020f34df3b2e4e9c47a18df4bf08376ec75b5c8ecdb0a97e9481c2d2
|
Provenance
The following attestation bundles were made for pysecop-1.1.1.tar.gz:
Publisher:
python-publish.yml on 26-jorge-01/pysecop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysecop-1.1.1.tar.gz -
Subject digest:
39516e101427d2cd5e2bccaefafecb9145b98bde80d92e4e78866d9c2ebbd72c - Sigstore transparency entry: 1096926825
- Sigstore integration time:
-
Permalink:
26-jorge-01/pysecop@0ae0345b7d5407bd8f39c8c2d5dd59c4a8f9000d -
Branch / Tag:
refs/tags/1.1.1 - Owner: https://github.com/26-jorge-01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0ae0345b7d5407bd8f39c8c2d5dd59c4a8f9000d -
Trigger Event:
release
-
Statement type:
File details
Details for the file pysecop-1.1.1-py3-none-any.whl.
File metadata
- Download URL: pysecop-1.1.1-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7834eb8723acfc5d4e6ad890b2cc5e9a0e3e51a4095ceeb98429699eb44149b2
|
|
| MD5 |
a07c3a51a957be583580baaca9581dca
|
|
| BLAKE2b-256 |
cd8b7906a16d453c43ef7ee3a62e3b085935f13e2a569b3617b27ba3cde8d9e6
|
Provenance
The following attestation bundles were made for pysecop-1.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on 26-jorge-01/pysecop
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysecop-1.1.1-py3-none-any.whl -
Subject digest:
7834eb8723acfc5d4e6ad890b2cc5e9a0e3e51a4095ceeb98429699eb44149b2 - Sigstore transparency entry: 1096926827
- Sigstore integration time:
-
Permalink:
26-jorge-01/pysecop@0ae0345b7d5407bd8f39c8c2d5dd59c4a8f9000d -
Branch / Tag:
refs/tags/1.1.1 - Owner: https://github.com/26-jorge-01
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@0ae0345b7d5407bd8f39c8c2d5dd59c4a8f9000d -
Trigger Event:
release
-
Statement type: