Skip to content

Instantly share code, notes, and snippets.

View senpos's full-sized avatar

Yevhenii Kovalchuk senpos

View GitHub Profile
from os import environ
import requests
def main():
account_id = environ["SMARTCAT_ACCOUNT_ID"]
apikey = environ["SMARTCAT_APIKEY"]
base_url = environ["SMARTCAT_BASE_URL"]
import json
from pathlib import Path
import httpx
with Path("./config.json").open() as f:
config = json.load(f)
documents_model = [
{
import httpx # pip install httpx
import typer # pip install typer
from rich import print # pip install rich
from rich.table import Table # pip install rich
def cli(
account_id: str = typer.Option(..., envvar="SMARTCAT_ACCOUNT_ID"),
apikey: str = typer.Option(..., envvar="SMARTCAT_APIKEY"),
base_url: str = typer.Option(
import json
from os import environ
from pathlib import Path
import requests
def main():
account_id = environ["smartcat_account_id"]
apikey = environ["smartcat_apikey"]
import asyncio
import json
import httpx
async def main():
client = httpx.AsyncClient(
auth=("Your Account ID", "Your APIKEY",),
headers={"Accept": "application/json"},
import asyncio
import json
import logging
import httpx
from dynaconf import settings
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger(__file__)
@senpos
senpos / dotstrings_parser.py
Created March 1, 2019 06:49
Playing with lark
from lark import Lark, Transformer # pip install lark-parser
grammar = r"""
%import common.ESCAPED_STRING
%import common.WS
string: ESCAPED_STRING
item: string "=" string [";"]
items: item*