Giter Club home page Giter Club logo

pycaruna's People

Contributors

akaihola avatar kimmolinna avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycaruna's Issues

pycaruna stopped working after Caruna shut down their old service

Hi,

pycaruna stopped working today after Caruna removed their good old Energiaseuranta section from their online service. The new Energiaseuranta is at the moment only displaying the consumption data in graph format only.

I just had a chat with Caruna customer service and they promised that their system should be updated with a new version "tomorrow or latest by the end of this week" which would contain the consumption data in numerical format (and as CSV).

Let's see what happens and how complex it will be to grab the consumption data from the new Energiaseuranta...

Cheers,
Markus

Version of python?

Which version on python this requires? I upgraded to 3.9 but I'm still getting error:

Traceback (most recent call last):

File "./pycaruna/pycaruna.py", line 5, in
def login_caruna (username: str,password: str|None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

Missing license

Hi,

Can you add a LICENSE file to the repository? I'd like to fork this and use it but technically it's proprietary at the moment, since you haven't specified a license at all.

Thanks!

Newbie question

Hi,

just have to ask, is this still working. Very new to python so before I bang my head to wrong table, please confirm :-)
Thanks for your work!

stopped working

I started getting the following error about a week ago, maybe the caruna site has changed?

Traceback (most recent call last):
File "/Users/hannuteras/git/tuya/caruna/caruna.py", line 46, in
(session,info) = pycaruna.login_caruna(username, password)
File "/Users/hannuteras/git/tuya/caruna/pycaruna.py", line 50, in login_caruna
soup = BeautifulSoup(s.get(str(url)).content,'lxml')
File "/opt/homebrew/Caskroom/miniconda/base/envs/tuya/lib/python3.10/site-packages/requests/sessions.py", line 542, in get
return self.request('GET', url, **kwargs)
File "/opt/homebrew/Caskroom/miniconda/base/envs/tuya/lib/python3.10/site-packages/requests/sessions.py", line 515, in request
prep = self.prepare_request(req)
File "/opt/homebrew/Caskroom/miniconda/base/envs/tuya/lib/python3.10/site-packages/requests/sessions.py", line 443, in prepare_request
p.prepare(
File "/opt/homebrew/Caskroom/miniconda/base/envs/tuya/lib/python3.10/site-packages/requests/models.py", line 318, in prepare
self.prepare_url(url, params)
File "/opt/homebrew/Caskroom/miniconda/base/envs/tuya/lib/python3.10/site-packages/requests/models.py", line 392, in prepare_url
raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'e,chrome=1': No scheme supplied. Perhaps you meant http://e,chrome=1?

Pycaruna stopped working on Dec 7, 2022

Hi,

I guess Caruna has made some changes in their end around 7 December 2022 which caused pycaruna to stop working.

The login method fails:

import pycaruna
session = pycaruna.login_caruna("my-username", "my-password")

Results in the following traceback...

Traceback (most recent call last):
  File "/path/to/pycaruna/fetch.py", line 2, in <module>
    session = pycaruna.login_caruna("my-username", "my-password")
  File "/path/to/pycaruna/pycaruna.py", line 65, in login_caruna
    r = s.get(url)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/usr/lib/python3/dist-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/usr/lib/python3/dist-packages/requests/models.py", line 390, in prepare_url
    raise MissingSchema(error)
requests.exceptions.MissingSchema: Invalid URL 'e,chrome=1': No schema supplied. Perhaps you meant http://e,chrome=1?

Any ideas, anyone?

Cheers,
Markus

Sample code doesn't work

Sample code:

import pycaruna
session = pycaruna.login("username", "password")
customer = pycaruna.get_current(session)
metering_points = pycaruna.get_metering_points(session, customer)
consumption = pycaruna.get_cons_hours(session, customer, metering_point, "2022-11-01", "2022-11-30")
response = pycaruna.logout(session)

Issue1: 2nd row should be session = pycaruna.login**_caruna**...

Issue2:

Traceback (most recent call last):
  File "/home/rhk/pycaruna_kimmolinna/rcaruna.py", line 5, in <module>
    consumption = pycaruna.get_cons_hours(session, customer, metering_point, "2022-12-01", "2022-12-04")
NameError: name 'metering_point' is not defined. Did you mean: 'metering_points'?

changed to metering_points but got

Traceback (most recent call last):
  File "/home/rhk/pycaruna_kimmolinna/rcaruna.py", line 5, in <module>
    consumption = pycaruna.get_cons_hours(session, customer, metering_points, "2022-12-01", "2022-12-04")
  File "/home/rhk/pycaruna_kimmolinna/pycaruna.py", line 122, in get_cons_hours
    r=s.get("https://energiaseuranta.caruna.fi/api/meteringPoints/ELECTRICITY/"+metering_point+"/series?products=EL_ENERGY_CONSUMPTION&resolution=MONTHS_AS_HOURS&customerNumber="+customer+"&startDate="+start_day+"T00:00:00-0000&endDate="+end_day+"T00:00:00-0000")
TypeError: can only concatenate str (not "list") to str

Issue3: Last row should have pycaruna.logout**_caruna**(session)

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.