Skip to main content

sdk for factweavers datacloud

Project description

FWSDK - FactWeavers Python SDK

FWSDK is a Python SDK that enables easy interaction with the FactWeavers platform. It supports operations like listing entities, creating silver and gold entities, deleting entities, and managing their schedules — all via Python.


📦 Installation

Install via pip (after publishing to PyPI):

pip install fdc_sdk

Or install locally for development:

pip install .

🚀 Quick Start

from fdc_sdk import FWClient

# Initialize the client
client = FWClient(
    base_url="https://dev.factweavers.com",
    org="1",
    secret_key="your_secret_token_here"
)

# List all bronze entities
entities = client.list_all_entities(layer="bronze")
print(entities)

# Create a silver entity
client.create_silver_entity(
    entity_name="Landmark_combined",
    sql_query="""
        SELECT a, b, c FROM Landmark_raw_nav
        UNION
        SELECT a, b, c FROM Landmark_raw_bc
    """
)

# Create a gold entity
client.create_gold_entity(
    entity_name="Landmark_gold_summary",
    sql_query="SELECT * FROM Landmark_combined WHERE region = 'US'"
)

# Delete an entity
client.delete_entity("Landmark_gold_summary")

# Disable schedule for an entity
client.disable_schedule("Landmark_combined")

📚 API Methods

FWClient(base_url, org, secret_key)

Creates a client to interact with the FactWeavers backend.


list_all_entities(layer="BRONZE", q="", sort_by="updated_at", sort_order="asc")

Fetch all entities from a specific layer. Internally fetches the total count and retrieves paginated results.


create_silver_entity(entity_name, sql_query)

Create a new silver entity by passing the entity name and SQL query.


create_gold_entity(entity_name, sql_query)

Create a new gold entity with the specified SQL logic.


delete_entity(entity_name)

Delete an existing entity using its name.


disable_schedule(entity_name)

Disable the schedule for a specific entity.


🔐 Authentication

Your secret_key must be valid and authorized for the target organization. All requests use the format:

Authorization: Bearer <secret_key>
X-Organization: <org>

🧪 Testing

Use a sample script like the following to test locally:

from fdc_sdk import FWClient

client = FWClient("https://dev.factweavers.com", "1", "your_token")
print(client.list_all_entities("bronze"))

🤝 Contributions

We welcome contributions! Please fork the repo and submit a pull request. For major changes, open an issue first to discuss what you would like to change.


📄 License

MIT License © 2025 FactWeavers

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fdc_sdk-0.0.3.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fdc_sdk-0.0.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file fdc_sdk-0.0.3.tar.gz.

File metadata

  • Download URL: fdc_sdk-0.0.3.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for fdc_sdk-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b7ded41d690c585d964b8fd7a9912833fbe72be30179f3541485954a64d09e30
MD5 e7fe504654c84ef31fd7df3cae1c4cde
BLAKE2b-256 562bbdd93cb75b42251c24cb0bc169e28869a0b213b8ca3b643d18ccc60d3db8

See more details on using hashes here.

File details

Details for the file fdc_sdk-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: fdc_sdk-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.20

File hashes

Hashes for fdc_sdk-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4130361cd42d735be5ca366cd915d78ebdaa0e57aa826108159e52be18113cc3
MD5 722aa24648e655403cf47041e5982b6e
BLAKE2b-256 4d5133e4206111a0b011e2e7387325f2a77dd2d8f35d8c8cb0fafeb0d2107644

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page