Giter Club home page Giter Club logo

pygexf's People

Contributors

boogheta avatar fiedzia avatar paulgirard avatar virtuald avatar

Stargazers

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

Watchers

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

pygexf's Issues

write() function

when I save gexf file using write() function just like this:

output_file=open(".\data.gexf","w")
gexf.write(output_file)

program report an error:
write() argument must be str, not bytes

how can I fix it?

New release with python3 support?

The git seems to support python3, however the latest release does not.

There are a lot of people downstream that would like a static release version that supports python3 as this is needed for applications, including a package I maintain in Arch's AUR, and that manjaro has contacted me about support.

Node spells error

_gexf.py in line 480 should be modified from

self.spells = spells

to code like in line 633

self.spells = Spells(spells)

viz setting for nodes

It would be nice to be able to set the viz settings (in particular, the node location) for a given node. I'd love to implement this.

New API with less parameters

The current API requires a lot of method parameters (Gexf constructor, Gexf.addNode, Gexf.addEdge) my proposition is to separate required parameters which will still be set via parameters and optional parameters which will be set by setting properties.

I understand that this is a rather cosmetic change. Also I'd like to deprecate old methods to superseed them with pep8_compliant_method_names. This will make, I hope, the library more easier to the mind.

Adding attribute

It is to me not clear how to add an attribute to a node or an edge using pygexf.

If I try this:
graph.edges[edge_id].addAttribute(id=attr_id, value=something)

I get:
Traceback (most recent call last): File "gexf.py", line 43, in <module> graph.edges[edge_id].addAttribute(id=attr_id, value=something) File "/usr/local/lib/python2.7/dist-packages/pygexf-0.2.2-py2.7.egg/gexf/_gexf.py", line 646, in addAttribute self._attributes.append(makeAttributeInstance(self,"node",id,value,start,end,startopen,endopen)) NameError: global name 'makeAttributeInstance' is not defined

What is the recommended way of adding attributes to nodes or edges?

I am using latest git by the way.

problem with coding with python3

I ran the demo:

from gexf import Gexf  
test helloworld.gexf  
gexf = Gexf("Paul Girard","A hello world! file")  
graph=gexf.addGraph("directed","static","a hello world graph")
graph.addNode("0","hello") 
graph.addNode("1","World") 
graph.addEdge("0","0","1")
output_file=open("hellowrld.gexf","w") 
gexf.write(output_file)

but I built with python3, I got:

TypeError: write() argument must be str, not bytes

even though I know that the source code is telling us:

def write(self, file, print_stat=True):
      file.write(etree.tostring(self.getXML(), pretty_print=True, encoding='utf-8', xml_declaration=True))
      if print_stat is True:
               self.print_stat()

what's wrong?

Don't write stats to stdout or make it optional

I wrote a little script that uses pygexf and wanted to use the canonical unixism of redirecting the stdout to a file or program. But this is not possible as the gexf that is produced when gexf.write(sys.stdout) is called, includes the stats banner. The stats printing should go to stderr or be optional to print out. Maybe add a stats=True/False argument to the Gexf() call?

Thanks for the very useful library.

gexf v1.2draft support

http://gexf.net/format/history.html <-- there have been some changes, especially in the (in this library nonexisting?) handling of the timetype/timeformat field.

Since I'd like to use exactly that, please take a look at this library again and update it to Version 1.2draft (maybe optional).

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.