Comments (5)
Sure, I'd be happy to merge those docs. Although the referenced ticket, which I've intentionally left open, makes it sound like there could be a preferable API for reading/writing XML?
from pymarc.
@nichtich do you know if lxml.etree.iterparse reads the entire document into memory, and then iterates over that?
from pymarc.
@nichtich Will this new documentation help clarify the current state of affairs with XML and JSON? It can always get updated if there does turn out to be progress on #73. If you have any suggestions for improving it please send them along.
from pymarc.
@edsu Thanks for the new documentation that's very helpful, I did not know about map_xml
. Writing XML is possible nevertheless. The following is possibly no beautiful Python but should work:
# write XML header to file object
file.write('<?xml version="1.0" encoding="UTF-8"?>\n')
file.write('<collection xmlns="http://www.loc.gov/MARC21/slim">\n')
# write records
for record in records:
file.write(marcxml.record_to_xml(record).decode("utf-8"))
file.write('\n')
# write XML footer
file.write('</collection>')
file.close()
from pymarc.
That would be better expressed in a separate pull request. If the documentation suffices for now I'm going to close this.
from pymarc.
Related Issues (20)
- Add encoding option to marcxml.record_to_xml HOT 4
- field .indicators, indicator1, indicator2 confusion HOT 3
- Make leader mutable? HOT 14
- A permissive MARCReader HOT 4
- MARCReader obscure warning: couldn't find 0xa0 in g0=66 g1=69 HOT 11
- YAZ - collecting data and printing them with PYMARC HOT 1
- Convert README to PyPI description? HOT 3
- How to analyze the bad.dat HOT 1
- New release to PyPI to make Python 3 support official? HOT 2
- Corrupt / Incompatible data: couldn't find 0x20 in g0=83 g1=69 HOT 1
- Add subfields at an arbitrary position HOT 2
- Correct the readme to avoid new errors HOT 1
- License HOT 8
- Tests fail on python 3.8
- v4.0.0? HOT 25
- Linting
- Python3 HOT 4
- License HOT 1
- Organization account? HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pymarc.