Giter Site home page Giter Site logo

liveodds's Introduction

Requirements

To build you will need Nim compiler, I would recommend using Choosenim to install and manage.

Python 3.7 or greater and the Nimporter and orjson packages are required. These can be installed with Pip.

pip install nimporter orjson
Install
git clone https://github.com/joenano/liveodds.git

Build files are included for compiling the library, or copy and paste from here.

Linux
nim c --gc: orc --threads:on --app:lib -d:ssl -d:release --out:lib/odds.so src/odds.nim
Windows
nim c --gc: orc --threads:on --app:lib --tlsEmulation:off -d:ssl -d:release --out:lib/odds.pyd src/odds.nim
Example
from lib.liveodds import Liveodds

liveodds = Liveodds()

# get tuple of all available races
races = liveodds.all_races()

# get dictionary of odds for all races
odds = liveodds.odds(races)
Structure

json

json

Will add more examples later, in the meantime, more info in docs.

liveodds's People

Contributors

joenano avatar

Stargazers

Harley Rockhill avatar  avatar  avatar  avatar Garry Bettle avatar

Watchers

Garry Bettle avatar  avatar

liveodds's Issues

native python app

Thank you for your work, it's interesting.

I'm attempting to recreate it using 100% python. However, it looks like there's a missing file within the lib folder; odds - checking the history it doesn't look like it was ever committed, is that correct?

Any help is appreciated.
Thanks

Cannot open file nimpy

Hi Joe,

Many thanks for the repo - hope I can get it working.

I've downloaded all requirements and nim is installed.

C:\Users\garry\Downloads\liveodds>python example.py
Traceback (most recent call last):
File "example.py", line 5, in
from lib.liveodds import Liveodds
File "C:\Users\garry\Downloads\liveodds\lib\liveodds.py", line 4, in
import lib.odds as odds
ModuleNotFoundError: No module named 'lib.odds'

C:\Users\garry\Downloads\liveodds>build.bat

C:\Users\garry\Downloads\liveodds>nim c --gc: orc --threads:on --app:lib --tlsEmulation:off -d:ssl -d:release --out:lib/odds.pyd src/odds.nim
Hint: used config file 'C:\Users\garry\Downloads\nim-1.6.2_x64\nim-1.6.2\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\garry\Downloads\nim-1.6.2_x64\nim-1.6.2\config\config.nims' [Conf]
......................................................................................................................................
C:\Users\garry\Downloads\liveodds\src\odds.nim(4, 8) Error: cannot open file: nimpy
C:\Users\garry\Downloads\liveodds>pip install nimpy
ERROR: Could not find a version that satisfies the requirement nimpy (from versions: none)
ERROR: No matching distribution found for nimpy

C:\Users\garry\Downloads\liveodds>tree /f
Folder PATH listing
Volume serial number is A627-C555
C:.
│ build.bat
│ build.sh
│ example.py
│ README.md
│ requirements.txt

├───docs
│ liveodds.html

├───lib
│ │ liveodds.py
│ │ odds.so
│ │
│ └───__pycache__
│ liveodds.cpython-38.pyc

└───src
│ odds.nim

└───utils
bookies.nim
xmlfuncs.nim

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.