semvec/pypi-packages huggingface dataset:
bitbank-client 0.1.1
bitbank-client is a python client (sync/async) library for bitbank api.
License: MIT
Keywords: bitbank

bitbank-client
==============

|PyPI version| |License: MIT|

bitbank-client is a python client (sync/async) library for bitbank api

Installation
------------

::

   $ pip install bitbank-client

Usage
-----

.. code:: python

   #
   # sync
   #
   from bitbank_client.sync import Client

   client = Client(public_key='your api key', private_key='your api secret')
   response = client.get_ticker(pair='btc_jpy')
   print(response.status_code, response.json())

   #
   # async
   #
   import grequests
   from bitbank_client.async import Async

   client = Async(public_key='your api key', private_key='your api secret')
   reqs = [client.get_ticker(pair='btc_jpy'), client.get_depth(pair='btc_jpy'), ...]
   response = grequests.map(reqs)
   for r in response:
       print(r.status_code, r.json())


   client.get_ticker(pair='btc_jpy') # GET /{pair}/ticker
   client.get_depth(pair='btc_jpy') # GET /{pair}/depth
   client.get_transactions(pair='btc_jpy') # GET /{pair}/transactions
   client.get_transactions(pair='btc_jpy', yyyymmdd='20180509') # GET /{pair}/transactions/{YYYYMMDD}
   client.get_candlestick(pair='btc_jpy', candle_type='1day', yyyymmdd='2018') # GET /{pair}/candlestick/{candle-type}/{YYYY}
   client.get_candlestick(pair='btc_jpy', candle_type='1hour', yyyymmdd='20180510') # GET /{pair}/candlestick/{candle-type}/{YYYY}
   client.get_assets() # GET /user/assets
   client.get_order(pair='btc_jpy', order_id=1) # GET /user/spot/order
   client.order(pair='btc_jpy', amount=1, price=1, side='buy', type='limit') # POST /user/spot/order
   client.cancel_order(pair='btc_jpy', order_id=1) # POST /user/spot/cancel_order
   client.cancel_orders(pair='btc_jpy', order_ids=[1,2]) # POST /user/spot/cancel_orders
   client.orders_info(pair='btc_jpy', order_ids=[1,2]) # POST /user/spot/orders_info
   client.get_active_orders(pair='btc_jpy') # GET /user/spot/active_orders
   client.get_trade_history(pair='btc_jpy') # GET /user/spot/trade_history
   client.get_withdrawal_account(asset='btc') # GET /user/withdrawal_account
   client.request_withdrawal(asset='btc', uuid=1, amount=1) # POST /user/request_withdrawal
   client.request_withdrawal(asset='btc', uuid=1, amount=1, otp_token='xxx') # POST /user/request_withdrawal
   client.request_withdrawal(asset='btc', uuid=1, amount=1, sms_token='xxx') # POST /user/request_withdrawal

Contributing
------------

1. Fork it
2. Create your feature branch (``git checkout -b my-new-feature``)
3. Commit your changes (``git commit -am 'Add some feature'``)
4. Push to the branch (``git push origin my-new-feature``)
5. Create new Pull Request

.. |PyPI version| image:: https://badge.fury.io/py/bitbank-client.svg
   :target: https://badge.fury.io/py/bitbank-client
.. |License: MIT| image:: https://img.shields.io/badge/License-MIT-yellow.svg
   :target: https://opensource.org/licenses/MIT
pelican-ga-pageview 0.1.1
Pelican google analytics plugin modified to work with nice-blog theme
License: MIT

# pelican-ga-pageview
Google analytics pageview plugin to work with nice blog theme


## Page View using Google Analytics
If you track your site's page view using Google Analytics, this plugin can pull
the page view information from your Google Analytics profile and add a
``page_view`` attribute to each article and page in your Pelican site. See a
live example here.

http://jwkennington.com


## Requirements and Setup

First, follow the `instructions here
<https://developers.google.com/analytics/devguides/reporting/core/v3/quickstart/service-py>`_
to set up Google API service account.

Then in Google Analytics, add the email address you created above as an user so
that we can access the Google Anaytics API.

At this point, you should have:

- Google API service email: ``<prioject_id>-<unique_id>@developer.gserviceaccount.com``
- Google private key file: ``client_private.p12``. Save this file somewhere
  secure. If you put this file in a Git repository, don't forget to add it to
  ``.gitignore``.


Finally, install the Google API Python library:

```bash
pip install --upgrade google-api-python-client
```


## Settings

You need to provide the following information in your Pelican configuration file
for this plugin to communicate with the Google Analytics API.

- ``GOOGLE_SERVICE_ACCOUNT``: the service email.
- ``GOOGLE_KEY_FILE``: path to the private key file, E.g.
  ``./client_private.p12``.
- ``GA_START_DATE``: start date to count page view. E.g., ``2005-01-01``.
- ``GA_END_DATE``: end date to count page view. E.g., ``today``.
- ``GA_METRIC``: counting metrics, default is ``ga:pageviews``. See other options
  `here
  <https://developers.google.com/analytics/devguides/reporting/core/dimsmets>`_.
  Right now we only support query with ONE metric.
- ``POPULAR_POST_START``: start date to count popular page views. E.g., ``A
  month ago``.


With this plugin installed, each ``article`` and ``page`` object has two extra
attributes:

- ``pageview``: total number of page views between ``GA_START_DATE`` and
  ``GA_END_DATE``.
- ``popular_pageview``: total number of page view between ``POPULAR_POST_START``
  and ``GA_END_DATE``.

And there is one global context named ``total_page_view``,
which is the total page view of the entire site.


## Note

If you encounter this error while building:

```bash
NotImplementedError: PKCS12 format is not supported by the PyCrypto library.
```

Try convert the ``p12`` file to ``pem`` file:

```bash
openssl pkcs12 -in client_private.p12 -nodes -nocerts > client_private.pem
```

The password should be ``notasecret``.

Then set ``GOOGLE_KEY_FILE`` to be the ``pem`` file just generated.



## Resources

- `Google Analytics Core Reporting API
  <https://developers.google.com/analytics/devguides/reporting/core/v3/reference>`_
- `Google Analytics Query Explorer
  <https://ga-dev-tools.appspot.com/query-explorer/>`_


## Attribution
This plugin is based on the [ga_pageview plugin](https://github.com/jhshi/pelican.plugins.ga_page_view)