Package: open-crypto
Introduction to the Data Collectoropen-cryptoThis is a short introduction to the package calledopen-crypto. The program offers generalizedREST-API requeststo over100of the largest and most liquidcryptocurrency exchangesand several well-knownplatforms. To this point, the program can request (see examples below):TickerdataTransactiondataHistorical-RatedataOrder-BookdataAggreg. PlatformdataWe offer an open-source tool which fits the needs for unprocessed and aggregated data in a new, fast, flexible and in many cases unexplored industry.
Along with this short introduction we provide several examples to execute listed at the end.PrerequisitesPython >= 3.8Getting startedFor installation, execute:pipinstallopen-cryptoin your command prompt. Ensure to set the Python executable as path variable. This can be selected during the installation process.Run the programThe program is initialized using a configuration file. In order to keep things simple, we offer several exemplary configurations, one for each request method.In order to make adjustments, all files and collected data will be copied to your current working directory, including the configuration, exchange mappings, log files and database(s). Therefore run the module in the desired directory.The modulerunneroffers several functionalities to control the program:>>>runner.check_path()# check if resources are in your working directory.>>>runner.update_maps()# download the lastest exchanges mappings from the GitHub repository>>>runner.copy_resources()# copy the resources into the currency working directory>>>runner.get_session()# return an open database connection.>>>runner.exchanges_and_methods()# return all implemented exchanges and their supported API endpoints.>>>runner.get_config()# print a specified or the actual configuration file>>>runner.get_config_template()# return an empty configuration file to the resource directory.>>>runner.export()# allow exporting data from the database into csv/hdf-files.>>>runner.run()# start the program.To start the data collector, openPythonwithin your working directory of choice and import the program:>>>fromopen_cryptoimportrunner>>>runner.update_maps()UpdatingexchangemappingsfromGitHub..100%The first command will import the modulerunner. Withinrunnerthe functionupdate_mapswill download the latest exchange mappings from GitHub and (if the folder already exists overwrite) allresourcesinto your working directory.Personalized requests can be made by first creating a new configuration file template:>>>runner.get_config_template()Creatednewconfigtemplate.The file can be found under:[your/cwd]/resources/configs/user_configs/request_template.yaml. Open and manipulate the file with a text editor of choice. Consider renaming the file accordingly.Finally, read in the file and execute the program:>>>fromopen_cryptoimportrunner>>>runner.run()Enterconfigfilename:<your_file_name>For a first impression, consider executing the following examples before creating personalized tasks.ExamplesBy default, several example scripts are offered and can easily be executed:exchange_listings()static()trades()order_books()platform()minute_candles()To runopen_cryptowith one of the mentioned configuration files:>>>fromopen_cryptoimportrunner>>>runner.Examples.minute_candles()Note that all examples will result in a plot of the received data. Furthermore, especiallystatic,exchange_listingsmay take several minutes.