semvec/pypi-packages huggingface dataset:
spikelib 0.1.1
Set of tools to analyze neuronal activity from spiketimes

# spikelib

A Python package for reading, manipulating, analyzing and visualize spike
sorted extracellular data.
The spikelib was designed to give a suite of tools that allow us to analyze
spiketrains from multi-electrode array (MEA) recordings obtained from some
spike sorting software (for example spiking-circus).

## Installation

### Dependencies
This is the list dependencies


```sh
pip install numpy scipy matplotlib scikit-learn peakutils pandas h5py lmfit
```

Optionally you can install neuroshare to read .mcd files. But it only work on
Python 2.7
```sh
pip install neuroshare
```

### Install
There are 2 ways to install spikelib, from Pypi or github. The easier way is install using pip.

```sh
pip install spikelib
```

Alternatively, you can install the latest version of spikelib from github  running the following commands:

```sh
git clone https://github.com/creyesp/spikelib
cd spikelib
python setup.py [install, develop]
```

Where the develop argument should be used if you want to modify the code.
IBATS-Huobi-Feeder 0.1.3
连接 Huobi 火币交易所，获取实时行情、历史行情，保存到mysql数据库同时redis广播，供 IBATS 交易平台进行策略回测、分析，交易使用
Requires Python: >=3.6

﻿# [Huobi Feeder](https://github.com/IBATS/IBATS_HuobiFeeder)
连接火币交易所

通过 feed.md_feeder 接受事实行情及补充历史数据

通过 backend.handler 处理实时行情，保持到数据库，进行redis广播

该项目作为 IBATS 框架的 Feeder 组件可独立部署



## 安装

#### 系统环境要求：

> Python 3.6 
>
> MySQL 5.7  [配置方法总结了一下，见下文](#mysql-配置方法)
>
> Redis 3.0.6 

#### 安装必要python包

Windows环境

> pip install -r requirements.txt

Linux环境

> pip3 install -r requirements.txt

#### 配置文件

config.py
基础配置

1 ) MYSQL数据库用户名、密码
```python
DB_SCHEMA_MD = 'md_huobi'
DB_URL_DIC = {
    DB_SCHEMA_MD: 'mysql://m*:****@10.0.3.66/' + DB_SCHEMA_MD
}
```
2 ) 火币交易所 EXCHANGE_ACCESS_KEY、EXCHANGE_SECRET_KEY
```python
# api configuration
EXCHANGE_ACCESS_KEY = ""
EXCHANGE_SECRET_KEY = ""
```

可选配置

1 ) Redis 路径
```python
# redis info
REDIS_PUBLISHER_ENABLE = True
REDIS_INFO_DIC = {'REDIS_HOST': 'localhost',
                  'REDIS_PORT': '6379',
                  }
```
#### 启动方法

直接运行 run.bat

启动过程中会自动建立相应数据库表结构



## 存储及服务

存储mysql数据库

> md_min1_tick_bc  tick数据
>
> my_min1_bc   一分钟数据
>
> md_min60_bc  一小时数据
>
> md_daily_bc  日数据

## 实时行情Redis广播服务

channel格式：

```
md.{market}.{period}.{symbol}
#    例如：
#    md.huobi.Min1.ethusdt
#    md.huobi.Tick.eosusdt
```
订阅方式：
SUBSCRIBE md.huobi.Tick.eosusdt


## 欢迎赞助

#### 微信

![微信支付](https://github.com/mmmaaaggg/ABAT_trader_4_blockchain/blob/master/mass/webchat_code200.png?raw=true)

#### 支付宝

![微信支付](https://github.com/mmmaaaggg/ABAT_trader_4_blockchain/blob/master/mass/alipay_code200.png?raw=true)

#### 微信打赏（￥10）

![微信打赏](https://github.com/mmmaaaggg/ABAT_trader_4_blockchain/blob/master/mass/dashang_code200.png?raw=true)

## MySQL 配置方法

 1. Ubuntu 18.04 环境下安装 MySQL，5.7

    ```bash
    sudo apt install mysql-server
    ```
 2. 默认情况下，没有输入用户名密码的地方，因此，安装完后需要手动重置Root密码，方法如下：

    ```bash
    cd /etc/mysql/debian.cnf
    sudo more debian.cnf
    ```
    出现类似这样的东西
    ```bash
    # Automatically generated for Debian scripts. DO NOT TOUCH!
    [client]
    host     = localhost
    user     = debian-sys-maint
    password = j1bsABuuDRGKCV5s
    socket   = /var/run/mysqld/mysqld.sock
    [mysql_upgrade]
    host     = localhost
    user     = debian-sys-maint
    password = j1bsABuuDRGKCV5s
    socket   = /var/run/mysqld/mysqld.sock
    ```

    以debian-sys-maint为用户名登录，密码就是debian.cnf里那个 password = 后面的东西。
    使用mysql -u debian-sys-maint -p 进行登录。
    进入mysql之后修改MySQL的密码，具体的操作如下用命令：
    ```mysql
    use mysql;

    update user set authentication_string=PASSWORD("Dcba4321") where user='root';

    update user set plugin="mysql_native_password"; 

    flush privileges;
    ```
 3. 然后就可以用过root用户登陆了

    ```bash
    mysql -uroot -p
    ```

 4. 创建用户 mg 默认密码 Abcd1234

    ```mysql
    CREATE USER 'mg'@'%' IDENTIFIED BY 'Abcd1234';
    ```
 5. 创建数据库 bc_md

    ```mysql
    CREATE DATABASE `bc_md` default charset utf8 collate utf8_general_ci;
    ```
 6. 授权

    ```mysql
    grant all privileges on bc_md.* to 'mg'@'localhost' identified by 'Abcd1234'; 

    flush privileges; #刷新系统权限表
    ```