The library implements create short links via https://cli.com (Ex. cli.co) service.
Project description
clico
The library implements create short links via cli.com (Ex. cli.co) service.
cli.com documentation
Installation
$ pip install clico
Settings
Optional environment variables:
CLICO_API_KEY - Your API key
Using
from clico import Clico
from clico.models import Link, Domain, Integration
clico = Clico(api_key='YOUR_API_KEY')
or
clico = Clico() # If `CLICO_API_KEY` environment variable exists
single_link = clico.single_link(Link(**{
'domain': Domain.CLI_CO,
'target_url': 'https://google.com',
'callback_url': 'https://my-api.com/callback',
'is_deep': False,
'id_campaign': 'my-campaign',
'utm_phone': 'XXXXXXXXXXX',
'utm_source': 'twitter',
'utm_medium': 'banner',
'utm_campaign': '2019',
'utm_content': 'my ad',
'utm_term': 'term'
}))
multiple_links = clico.multiple_links([
Link(**{
'domain': Domain.CLI_CO,
'target_url': 'https://google.com',
'callback_url': 'https://my-api.com/callback'
}),
Link(**{
'domain': Domain.IN_SV,
'target_url': 'https://google.com',
'callback_url': 'https://my-api.com/callback',
'utm_phone': 'XXXXXXXXXXX',
'utm_term': 'term'
})
])
integration = clico.integration(Integration(**{
'callback_uri': 'https://my-api.com/callback',
'redirect_uri': 'https://google.com',
'user_data': {
'key': 'value'
}
}))
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
clico-0.2.tar.gz
(9.9 kB
view hashes)
Built Distribution
clico-0.2-py3-none-any.whl
(11.3 kB
view hashes)