Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
joeu-sg
@joeu-sg
I wonder if that is the correct requirements.txt After installing it, running pyspread.sh says PyQt5 is not found. Should that have been done from the requirements.txt ? thanks.
TashaSkyUp
@TashaSkyUp
@pedromorgan_gitlab I was following https://pyspread.gitlab.io/install.html as well.
@pedromorgan_gitlab even runnying pip install pyspread and then runn in the .bat in the downloaded github repo doesnt work
TashaSkyUp
@TashaSkyUp
wow trying to track down all the packages i need to install.. requirements.txt doesnt work
Martin Manns
@manns_gitlab
@pedromorgan_gitlab The openhub page refers to the old repo. Unfortunately, the openhub guys locked me out when they were sold. I have not found the time to get back into this site.
@samsquire There are two versions of pyspread: The stable version 1.1.3 and the alpha version 1.99.0.2 that is not on pip, yet. The alpha version has a requirements.txt file at the top level of the repo. However, it got lost when creating the tarball. You can find it at: https://gitlab.com/pyspread/pyspread/-/blob/master/requirements.txt
Martin Manns
@manns_gitlab
@joeu-sg The rquirements.txt file in the apidocs folder is only for building the API docs. It is not the one that you would need for installing pyspread 1.99.0.2
Martin Manns
@manns_gitlab
@pedromorgan_gitlab Do you think that it is a good time for bundling a first beta release that is published on PyPi? The main reason for holding back is the major Issue #34 on Mac that I have not been able to fix, yet.
Alexander Braverman Masis
@alexbmasis_gitlab
Hello, is it possible to do conditional formatting? it doesn't seem to exist as a global macro like charts, and I can't figure out how to do it with the global 'S'.
Martin Manns
@manns_gitlab

@alexbmasis_gitlab It is possible but not straight forward (for the example, I assume that you are using the Python 3 version of pyspread, i.e. >1.99.0): Enter

def color(value, condition_func, X, Y, Z):
    if condition_func(value):
        color = 255, 0, 0
    else:
        color = None

    S.cell_attributes[X,Y,Z]["bgcolor"] = color

    return value

into the macro panel and

color(5, lambda x: x>4, X, Y, Z)

into a cell. If you change the first parameter in the cell's function from 5 into 1 then the background color changes back to white.

Martin Manns
@manns_gitlab
I have just released pyspread 1.99.1. Main download site is https://pypi.org/project/pyspread/ Enjoy!
acollins782
@acollins782
I just download pyspread for the first time and I installed it from the anaconda prompt. Everything was installed properly as I got the message "Successfully installed pyspread-1.99.1". Now, a very basic question, how do I run it?! I ran it from inside IPython console in Spyder and I got the msg: " ..... dialogs.py",
line 50, in <module> from dataclasses import dataclass ModuleNotFoundError: No module named 'dataclasses' " and the msg: " ..... pyspread.py", line 61, in <module> from workflows import Workflows ImportError: cannot import name 'Workflows' ". What am I doing wrong? Thanks.
Martin Manns
@manns_gitlab
Please run version 1.99.1 from the command line and not from the ipython console. There is a script pyspread.sh for Linux and pyspread.bat for Windows to start it up. If you want to run pyspread from within the Python console, please clone the master branch at https://gitlab.com/pyspread/pyspread , go to the top level directory and type from pyspread.pyspread import main; main()
In the upcoming release 1.99.2, this will work as well.
Pete 'mash# Morgan
@pedromorgan_gitlab
u there ?
@manns_gitlab ??
Martin Manns
@manns_gitlab
@pedromorgan_gitlab Are you there as well?
Martin Manns
@manns_gitlab
I have just released 1.99.2. Enjoy.
Pete 'mash# Morgan
@pedromorgan_gitlab
@manns_gitlab a PR to make it automated .. got some time over next 2 days, amongst other things to catch up . .See u been busy !!
Michal
@michalmph_gitlab
@manns_gitlab Thank you very much for this beautiful piece of software. I've been eagerly waiting for Python3 support, and currently successfully running on my work Windows machine. I'm very grateful you decided to move to PyQt and push this forward. I'll try to experimentally replace excel with pyspread in my pipeline wherever I can, would you like some usability reports?
Martin Manns
@manns_gitlab
@michalmph_gitlab It is good to hear that pyspread is running well for you on Windows. I am curious to hear about your experience. We welcome not only bug reports but also suggestions e.g. on usability on our Issue tracker on gitlab https://gitlab.com/pyspread/pyspread/-/issues.
Michal
@michalmph_gitlab
Is it possible to move the formula entry field to one of the sidepanes and resize it? I think for some/most? cases it would display the data that's contained in the field better, be it python code, lists, etc.
Martin Manns
@manns_gitlab
Currently, it is not possible to move the entry line into a side pane. Could you please create a new issue in the tracker?
xdhmoore
@xdhmoore
Hello. I've been digging through the docs. Is it possible to edit a spreadsheet file procedurally via python or CLI? Or is it possible to export to CSV via python or CLI? It looks to me like the export to CSV code is centered around the dialogue.
Or maybe several dialogues
Martin Manns
@manns_gitlab
@xdhmoore A spreadsheet file (.pysu) is a plaint text file in utf-8 encoding. You can edit it with a text editor or with a script.
@xdhmoore Since slicing the grid e.g. via S[1:10, :5, 0] yields a numpy array, you can save this programmatically as a csv file using the macro editor or cell code. However you should make sure that it is not written on each cell update, which can be achieved by freezing the cell that calls the respective macro function.
Pete Morgan
@pedromorgan
@manns_gitlab Did u try the twine/pipy ??
Martin Manns
@manns_gitlab
@pedromorgan Not yet (busy). Furthermore, pypi requires a new version number each time. Maybe next weekend, I can push out 1.99.4.
Pete 'mash# Morgan
@pedromorgan_gitlab
that's another snag.. !! in real world code.. The inly way I got around is to have a version.txt file with tag..
What we need anyway is that when someone is using pyspread they can be alerted to a new version.. U blew that out with no externals// !!!
Stph Blk
@blkstph_gitlab
Kudos and thanks to you guys for writing this and making it available. I'm just at the beginning of the learning curve and my python isn't very strong, but I was looking for a "programmable" lighter weight spreadsheet to kludge a project tracking "database" together with "macros" and stumbled on this. I don't yet know if it is a reasonable fit for what I have in mind, but I do know it is exceptionally solid, powerful, well designed, responsive, and documented (polished) for an open source project I hadn't heard of before! Question: I need to store a lot of TEXT in various columns and rows; is there any easier way than using commas everywhere to have the spreadsheet recognize text as text? That is, I was expecting to see some sort of formatting option that would, by default, get the engine of pysheet to EXPECT text (no code) in certain cells instead of being freaked out by it. I haven't found any such feature.
Stph Blk
@blkstph_gitlab
I guess, for internal consistency, it would be fine to have a macro which automatically quoted certain inputs, but I don't see that, either. If it doesn't exist, maybe you could consider it for a future feature? The space between database applications and spreadsheets is sparse, as you doubtless know. Access seems to have been pretty much abandoned and ... well, I haven't tried Filemaker, but I am on Linux...but the Linux community has only a few things in that area and none that I have found (e.g., Kexi) are ready for prime time. That probably wasn't what you had in mind for pyspread, but it IS highly programmable and python IS pretty strong with strings, etc. So, well ... that's what I am going to try to stretch pyspread to do a little of.
Martin Manns
@manns_gitlab
@blkstph_gitlab Thank you for getting in touch. As I understand your question, the two documented ways, i.e. selecting all cells with text content and pressing <Ctrl>+<Enter> (identical to selecting Edit -> Quote cells) and importing strings from csv files, do not work for you because you would like to import text into cells programmatically from code in the macro editor. This can be done by using Pythons's builtin repr function. S[3,1,0]=repr("MyString") inserts code into the cell 3,1,0, which results in the string MyString being displayed.
Stph Blk
@blkstph_gitlab
Thank you, @manns_gitlab ! Let me explain further in case you have any other suggestions or see any obvious impossibilities (or have any thoughts in between, since this will be unknown for me): Sort of like on trello, I want to have four sheets for projects: new; active; pending; completed with one line per project. Projects get moved from one sheet to another by cutting and pasting. Eventually they get moved to "done" if they are completed -- or abandoned. I have used this sort of "kludge" for years to manage my personal big-picture tasks: It allows me to keep the list of "active" tasks to things I am committed to be working on in the next day or three, so I don't overwhelm myself or deceive myself, yet keeps looking at the other categories just a tab away. I have done this on a "dumb" spreadsheet and manually cut and paste but want to automate the process so I can hand the task off to someone else and reduce the risk that manually cutting and pasting is going to gum something up - I would prefer to have a button which moves the currently highlighted task and otherwise protects the sheets from some keyboard accident. I had hoped to do this with Kexi, but it is just not stable nor well documented (I has deleted my database twice); I tried Symphytum, but it is way underpowered. I could do this in excel, except (a) I am moving to linux and (b) it seems cool to have a python-based spreadsheet with enough power to create a stand-along app;-). I don't want to do this on the web, do to security issues, otherwise trello would probably do this. Any thoughts?
Stph Blk
@blkstph_gitlab
As an add-on thought, might it be worthwhile to support cells being EITHER capable of containing python expressions OR being designated "pure data"? I could see that being very, very useful (certainly for me) and generally useful provided (a) there was some way to easily, visually distinguish whether cells could only hold code or could only hold data (b) if data-only cells could be manipulated by code in other cells. Sort of like an eval function on what is otherwise a string. Not trying to unnecessarily complicate your program, but it would seem an elegant and massively powerful new capability if that can't yet be easily done. The segregation, though, would seem to me to be relatively easily added to pyspread (seem to me as I have the benefit of ignorance, perhaps;-)
Stph Blk
@blkstph_gitlab
What you are doing reminds me of what Alan Kay during a speech he was giving at a https://en.wikipedia.org/wiki/West_Coast_Computer_Faire. He specifically pointed out that spreadsheets were an example of a very powerful object and it should be possible to make them way more powerful than simple "macros" supported. I think he was thinking of Smalltalk powered, of course, but the impact of what he was proposing hit me right between the eyes, like a bullet. Alan Kay, more recently, has opined on how disappointed he is that things that were envisioned as just around the corner in the 1970's, or even had completely working prototypes, have STILL not been manifested. While all sorts of junk and bloat has filled all the extra storage, working memory, processing power, and human attention.
Martin Manns
@manns_gitlab
@blkstph_gitlab What you describe sound like what I am doing with gitlab: Move projects / tasks through different stages to keep track. If you go to Linux, you can set up a local gitlab server. However this runs in a Web browser at a local Web site.
Martin Manns
@manns_gitlab
Buttons that manipulate cell content are easy in pyspread. Just call a function defined in the macros from the button cell. You can protect the sheet from accidental changes by locking cells - but not against malicious intent.
Be aware that pyspread currently has no database backend but runs in memory. While you can integrate a database it would mean work. If concurrent usage was not needed, I would just store the spreadsheet file in a git folder and write a script to auto-commit on each change. However, this requires merging if multiple users are involved in a concurrent way.
In pyspread, one of the basic concepts is that there is no distinction between code and data. I do not understand your issue with that.
Nathan
@RudolfVonKrugstein
Hey, is there any documentation on how to use button cells? It is unclear to me which function is called when the button is clicked. What has to be the content of the cell to have a action called when the button is clicked?
Martin Manns
@manns_gitlab
@RudolfVonKrugstein The description indeed is missing in the docs. I have opened an issue. Button cells depict a button instead of the cell result. When the button is activated (on release), the cell code is executed. Therefore, you may call any function by pressing the button. Note that button cells work even if the cell is locked.
Nathan
@RudolfVonKrugstein
@manns_gitlab Ok, thanks for your answer! I was able to set the color of a cell by doing S.cell_attributes[X,Y,Z]["bgcolor"] = color from a button. But if I simple do S[X,Y,Z]=12 nothing happens.
So do I have to set the value of a cell in some other way?
Is there a way to get debug output from pyspread?
Martin Manns
@manns_gitlab
@RudolfVonKrugstein This type of assignment does not work in the last(!) line of a cell. Furthermore, cell assignment should not be used from within a cell as it may introduce too much complexity. Please use one of the following approaches:
  1. Set a global variable that the target cell refers to, i.e. in the cell a=1 and in the target cell a;
  2. Define the function in the macro editor, i.e. def set_cell(): S[1,2,0] = "234" and in the button cell set_cell()
Nathan
@RudolfVonKrugstein
@manns_gitlab That works, thanks a lot!
akhil-619
@akhil-619
New to coding, vba looks outdated and complex compared to python. Does this have potential to be new Excel?? Also please make this as much as familiar to Excel, layout and buttons , formulas for finance guys like us for easy transition. 😀
Martin Manns
@manns_gitlab
@akhil-619 Thank you for your positive feedback. Creating a Python spreadsheet and pushing it to this goal has been tried before by Resolver One (see https://en.wikipedia.org/wiki/Resolver_One) - without market success. Therefore, pyspread does not aim at mimicking Excel. Nevertheless, I think it may be worth a look - already being able to use a dedicated money library instead of float numbers for money cells should save more trouble than getting accustomed to another UI.
Robert Edström
@Legogris
Maybe I'm silly but how does one move rows or columns? e.g. swap two adjacent rows
Martin Manns
@manns_gitlab
@Legogris I have not published an implementation of row/column dragging because of two reasons: Switching long rows or columns takes too long for good usability and I found it too easy to mess up the spreadsheet with the feature. At the moment, please (1) insert a column where the column should be moved to, (2) cut the column that shall be moved, (3) paste it into the new column and (4) remove the now empty old column.