https://github.com/hardbyte/flick.jl
A very simple Julia client for the Flick api
https://github.com/hardbyte/flick.jl
Last synced: 6 months ago
JSON representation
A very simple Julia client for the Flick api
- Host: GitHub
- URL: https://github.com/hardbyte/flick.jl
- Owner: hardbyte
- License: apache-2.0
- Created: 2020-10-07T09:41:54.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-11-13T01:46:22.000Z (over 5 years ago)
- Last Synced: 2025-10-12T05:07:23.194Z (6 months ago)
- Language: Julia
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Flick.jl
A very basic Julia client for retrieving power prices from [Flick Electric](https://www.flickelectric.co.nz/).
As flick doesn't (yet) allow developers to register applications you have to use
the app tokens embedded in their mobile client app. Internally this package just calls the same
endpoints as the mobile app.
## Credentials
You can create a `credentials.json` file if you like, or configure at runtime.
```
{
"client_id": "le37iwi3qctbduh39fvnpevt1m2uuvz",
"client_secret": "ignwy9ztnst3azswww66y9vd9zt6qnt",
"username": "your email here",
"password": "your password here"
}
```
Note the `client_id` and `client_secret` have been baked into the Flick mobile application and they haven't changed in the last 3 years so you should be fine... However if they change feel free to open a PR to update the defaults here.
## Usage
```julia
using Flick
config = Flick.get_config("credentials.json")
auth_token = Flick.get_auth_token(config)
```
Alternatively give a username and password directly:
```julia
using Flick
auth_token = Flick.get_auth_token(username, password)
```
In any case once you have your `auth_token` use it to get the detailed price,
or the current price in cents:
```julia
current_price = Flick.get_current_price(auth_token)
println("Current freestyle price in cents: ", current_price.value)
price_detail = get_price_detail(auth_token)
```
Very much based off the Python client - [PyFlick](https://github.com/driannaude/PyFlick)