I think that you're going to struggle to find or make such a package.
To represent connections, there are plenty of netlist formats; several EDA packages use text-based formats for internal representation, and almost all can output a text-formatted netlist. This is probably the easiest third of what you want. I'm not aware of any that have a syntax that's easy to write and keep track of.
The labeling and definition functionality is typically contained in a part library. Again, there are text-based formats for this. Some manufacturers publish text-based pinouts of all their components to be used in generating a library. This functionality should probably be separated from the netlists, i.e. you'll do #import and then instantiate one.
Laying these components out in a sensible way is the last third of the problem, but it would be 99.99% of the effort. As Mark said, schematics are for humans. There are some basic rules, like voltages are higher on top and signals/data flows left to right that help make schematics more readable, but there's a lot of information contained in the arrangement of symbols that would be difficult, if not impossible, to represent in a netlist or other code format. Autorouters are a very high-dollar code project, and autoplace would be, if they could get it to work well. Those tools are used on PCBs, which don't generally contain semantic information in their placement.
If you can generate a schematic from code that's almost as readable as a human-designed schematic, then you'll be a millionaire in no time.