How to contribute
After clone repository
1.- Install dependencies
poetry install
2.- Run test
make test
3.- Run lint
make lint && make isort
How to publish new version
Once we have done a merge of our Pull request and we have the updated master branch we can generate a new version. For them we have 3 commands that change the version of our library and generate the corresponding tag so that the Bitbucket pipeline starts and publishes our library automatically.
make release-patch
make release-minor
make release-major
How works
This project provides an API for querying Salesforce opportunities data and transforming it into an easy-to-use format. The API is built upon the SalesforceQueryExecutor and Project classes, with the latter inheriting from SalesforceQueryExecutor.
Installation
Make sure you have Python 3.8+ installed. Then, install the required dependencies using poetry:
poetry install
Usage
First, import the necessary classes:
from ms_salesforce_to_bigquery.salesforce.project import Project
Then, initialize the Project class with your Salesforce credentials:
project = Project(
client_id="your_client_id",
username="your_username",
domain="your_domain",
private_key="your_private_key",
audience="https://login.salesforce.com", # Default value
session_duration_hours=1, # Default value
api_version='57.0', # Default value
)
Now, you can call the get_opportunities method with a query to get the opportunities data:
opportunities = project.get_opportunities()
The opportunities variable will contain an array of opportunity objects with the transformed data. For example:
[
{
"client_fiscal_name": "Five Eight Twenty-Two Consulting Inc.",
"client_account_name": "5822",
"currency": "CAD",
"amount": 30000.0,
"invoicing_country_code": "ES",
"operation_coordinator_email": "jhon.doe@ext.makingscience.com",
"operation_coordinator_sub_email": "jhon.doe@ext.makingscience.com",
"created_at": "2023-02-15T09:30:06.000+0000",
"last_updated_at": "2023-04-04T10:43:24.000+0000",
"opportunity_name": "5822 - OPORTUNITY NAME",
"stage": "Closed Won",
"billing_country": "CA",
"lead_source": "TEST LEAD SOURCE",
"project_code": "ESMSEX00000",
"project_id": "1234567890abcde",
"project_name": "PROJECT TEST NAME",
"project_start_date": "2023-02-01",
"controller_email": None,
"controller_sub_email": "jhon.doe@ext.makingscience.com",
"profit_center": None,
"cost_center": None,
"project_tier": "Unkown",
"jira_task_url": "https://makingscience.atlassian.net/browse/ESMSBD0001-00000",
"opportunity_percentage": 100.0
}
]
You can customize the query as needed to retrieve different data from Salesforce.
query = "SELECT Id, Name FROM Project WHERE Project.Id = 'ESMS0000'"
opportunities = project.get_opportunities(query)
Testing
To run the unit tests, simply execute the following command:
make test
This will run all the tests and display the results. Make sure that all tests pass before using the API in a production environment.
Metadata
Release files for ms-salesforce-to-bigquery 0.0.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ms_salesforce_to_bigquery-0.0.9.tar.gz | 21.1 kB | Without provenance | Details for ms_salesforce_to_bigquery-0.0.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ms_salesforce_to_bigquery-0.0.9-py3-none-any.whl | Python 3 | none | any | Details for ms_salesforce_to_bigquery-0.0.9-py3-none-any.whl |
Total release size: 46.1 kB
Release files / ms_salesforce_to_bigquery-0.0.9.tar.gz
| Download URL | ms_salesforce_to_bigquery-0.0.9.tar.gz |
|---|---|
| Size | 21.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2a8f4a7f21587debdf5ff1bb1253995acd44f32fc4aefb28d87d9f12290b8655
|
|
BLAKE2b-256 checksum How to use checksums |
6358d0a224cd7119d0dc4afcc7fe660cfbf1056e9b07926fc03cca4b85123f33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.6 Linux/5.15.0-1035-azure
|
Release files / ms_salesforce_to_bigquery-0.0.9-py3-none-any.whl
| Download URL | ms_salesforce_to_bigquery-0.0.9-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d53f4e1c33f2af8f1357f5d4e0415a0a74df3e871d1a8fcf04201812cfe787c4
|
|
BLAKE2b-256 checksum How to use checksums |
eb2e854084f6b2af26402e1f74e9b6e8cb06e13628a9338ba4cc08258a903403
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.2 CPython/3.10.6 Linux/5.15.0-1035-azure
|
Security for ms-salesforce-to-bigquery 0.0.9
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.